import request from '@/utils/request'

// 查询消息主题发布列表
export function listTopic(query) {
  return request({
    url: '/datafactory/topic/list',
    method: 'get',
    params: query
  })
}

// 查询消息主题发布详细
export function getTopic(id) {
  return request({
    url: '/datafactory/topic/' + id,
    method: 'get'
  })
}

// 新增消息主题发布
export function addTopic(data) {
  return request({
    url: '/datafactory/topic',
    method: 'post',
    data: data
  })
}

// 修改消息主题发布
export function updateTopic(data) {
  return request({
    url: '/datafactory/topic',
    method: 'put',
    data: data
  })
}

// 删除消息主题发布
export function delTopic(id) {
  return request({
    url: '/datafactory/topic/' + id,
    method: 'delete'
  })
}
export function  handleSyncTopic(){
    return request({
      url: '/datafactory/topic/syncTopic',
      method: 'post'
    })
}
// 启动或禁用作业
export function updateUseStatus(workIds , status) {
  return request({
    url: '/datafactory/topic/updateStatus?workIds=' + workIds + '&' + 'status=' + status,
    method: 'get'
  })
}
